package com.crm.jpaandthymeleaf.entity;

import javax.persistence.*;
import java.util.Objects;

/**
 * @author 周敬
 * @version 1.0
 * @packageName com.crm.jpaandthymeleaf.entity
 * @fileName Storage
 * @createTime 2021/12/15-20:19-星期三
 * @lastModify 2021/12/15-20:19-星期三
 */
@Entity
public class Storage {
    private long stkId;
    private long stkProdId;
    private String stkWarehouse;
    private String stkWare;
    private int stkCount;
    private String stkMemo;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "stk_id")
    public long getStkId() {
        return stkId;
    }

    public void setStkId(long stkId) {
        this.stkId = stkId;
    }

    @Basic
    @Column(name = "stk_prod_id")
    public long getStkProdId() {
        return stkProdId;
    }

    public void setStkProdId(long stkProdId) {
        this.stkProdId = stkProdId;
    }

    @Basic
    @Column(name = "stk_warehouse")
    public String getStkWarehouse() {
        return stkWarehouse;
    }

    public void setStkWarehouse(String stkWarehouse) {
        this.stkWarehouse = stkWarehouse;
    }

    @Basic
    @Column(name = "stk_ware")
    public String getStkWare() {
        return stkWare;
    }

    public void setStkWare(String stkWare) {
        this.stkWare = stkWare;
    }

    @Basic
    @Column(name = "stk_count")
    public int getStkCount() {
        return stkCount;
    }

    public void setStkCount(int stkCount) {
        this.stkCount = stkCount;
    }

    @Basic
    @Column(name = "stk_memo")
    public String getStkMemo() {
        return stkMemo;
    }

    public void setStkMemo(String stkMemo) {
        this.stkMemo = stkMemo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Storage storage = (Storage) o;
        return stkId == storage.stkId && stkProdId == storage.stkProdId && stkCount == storage.stkCount && Objects.equals(stkWarehouse, storage.stkWarehouse) && Objects.equals(stkWare, storage.stkWare) && Objects.equals(stkMemo, storage.stkMemo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(stkId, stkProdId, stkWarehouse, stkWare, stkCount, stkMemo);
    }
}
